﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace XbdSoft.InteropControls
{
    public partial class WinMediaPlayer : UserControl
    {
        //http://blog.csdn.net/afeilxc/article/details/6342954
        public WinMediaPlayer()
        {
            InitializeComponent();
        }

        private void WinMediaPlayer_Load(object sender, EventArgs e)
        {
            Player.uiMode = "Mini";
            Player.settings.autoStart = false;
        }


        public AxWMPLib.AxWindowsMediaPlayer Player
        {
            get { return axWinMediaPlayer; }
        }

        public string Url
        {
            get { return Player.URL; }
            set { Player.URL = value; }
        }
        public void Close()
        {
            Player.close(); 
        }

        public string UiMode
        {
            get { return Player.uiMode; }
            set { Player.uiMode = value; }
        }

        public void Pause()
        {
            Player.Ctlcontrols.pause();
        }
        public void Stop()
        {
            Player.Ctlcontrols.stop();
        }
        public void Play()
        {
            Player.Ctlcontrols.play();
        }
    }
}
